<#compress>
    <#assign actionname>${(action=='create')?string('新建','编辑')}</#assign>
    <@override name="title">${actionname}用户</@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-title">
            ${actionname}用户
                <small>${actionname}用户.</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/admin/home">
                        首页
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/auth/admin">
                        用户管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">
                    ${actionname}用户
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">用户信息</h6></div>
        <div class="panel-body">
            <form class="form-horizontal" action="${ctx}/admin/auth/admin/save" role="form" id="authUsersForm" method="post">
                <input name="authUsers.id" type="hidden" value="${authUsers.id!}"/>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="authUsersName">账号: <span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="text" class="required form-control input-xlarge" placeholder="账号"
                               name="authUsers.name" id="authUsersName" value="${authUsers.name!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="authUsersRealname">真实姓名:</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control input-xlarge" placeholder="真实姓名"
                               name="authUsers.real_name" id="authUsersRealname" value="${authUsers.real_name!}">
                    </div>
                </div>
                <#if action=='create'>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="authUsersPassword">用户密码:<span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="password" class="required form-control input-xlarge" placeholder="用户密码"
                               name="authUsers.password" id="authUsersPassword" value="${authUsers.password!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="okpassword">确认密码:<span
                            class="required">*</span></label>

                    <div class="col-sm-10">
                        <input type="password"  placeholder="确认密码"
                               class="required form-control input-xlarge"
                               name="confirm_password" id="okpassword" value="${authUsers.password!}">
                    </div>
                </div></#if>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="authUsers_role">角色: </label>

                    <div class="col-sm-10">
                        <select data-placeholder="选择角色" name="authUsers.role" id="authUsers_role" data-brand="${brand!}"
                                class="form-control input-xlarge select2me">
                            <option value="admin"
                                    <#if authUsers.role?? && authUsers.role == 'admin'>selected="selected"</#if> >管理员</option>
                            <option value="customer"
                                    <#if authUsers.role?? && authUsers.role == 'customer'>selected="selected"</#if> >客服人员</option>
                            <option value="merchant-ktv"
                                    <#if authUsers.role?? && authUsers.role == 'merchant-ktv'>selected="selected"</#if> >KTV商户</option>
                            <option value="merchant-repast"
                                    <#if authUsers.role?? && authUsers.role == 'merchant-repast'>selected="selected"</#if> >餐饮商户</option>
                        </select>
                    </div>
                </div>
                <div class="form-group" id="brand_form_group" style="display: none;">
                    <label class="col-sm-2 control-label" for="brand_field">商户品牌: </label>

                    <div class="col-sm-10">
                        <select data-placeholder="商户品牌" name="brand" id="brand_field"
                                class="form-control input-xlarge select2me">
                        </select>
                    </div>
                </div>
                <div class="form-actions text-right">

                    <a class="btn default yellow-stripe" href="${ctx}/admin/auth/admin"><i
                            class="fa fa-arrow-circle-o-left"></i> 返回</a>
                    <input type="submit" value="保存" class="btn btn-primary">
                </div>

            </form>
        </div>

    </div>
    </@override>

    <@override name="viewmodule">auth_admin_item</@override>
    <@extends name="../../_basic/main.ftl"></@extends>
</#compress>